class ListFiles extends JSCommand {
	
	private static final String cmdName = "ls";
	
	public String runCmd(String[] cmdArgs, JSDirectory workDir) {
		
		String result;
		boolean validArgs = isValidArgs(cmdArgs, workDir);
		
		if (validArgs) {
			result = workDir.getContents();
		} else {
			result = invalidArgsMessage;
		}
		
		return result;
	}
	
	private static boolean isValidArgs(String[] cmdArgs, JSDirectory workDir) { 
		return (cmdArgs[0] == cmdName &&
				cmdArgs.length == 1);	
	}
}